﻿using System;
using Budget.Silver.Core.Extensions;

namespace Budget.Silver.Model.Calendar
{
    public class DayModel
    {
        public DateTime Date { get; set; }

        public string Day
        {
            get
            {
                return Date == DateTime.MinValue ? string.Empty : Date.Day.ToString();
            }
        }

        //public string Week
        //{
        //    get { return Date == DateTime.MinValue ? string.Empty : Date.ToString("ddd", CultureInfo.CurrentCulture); }
        //}

        public int WeekNumber
        {
            get { return Date.GetWeekNumber(); }
        }

        public string Amount { get; set; }

        public bool IsEnabled
        {
            get { return Date != DateTime.MinValue; }
        }

        public DayModel()
        {
            Date = DateTime.MinValue;
            Amount = string.Empty;
        }

        public DayModel(DateTime date, decimal amount)
        {
            Date = date;
            Amount = ((int)amount).ToString();
        }
    }
}